package com.czl.dxpro.dx_07_taskSeven;
import java.io.IOException;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;


public class DxSevenMain {
public static void main(String[] args) throws IllegalArgumentException, IOException,
	ClassNotFoundException, IllegalStateException, InterruptedException {
	
	// TODO Auto-generated method stub
	Job job1 = Job.getInstance();
	job1.setJarByClass(DxSevenMain.class);
	job1.setMapperClass(SevenMapper.class);
	job1.setReducerClass(SevenReduce.class);
	job1.setMapOutputKeyClass(Text.class);
	job1.setMapOutputValueClass(IntWritable.class);
	job1.setOutputKeyClass(NullWritable.class);
	job1.setOutputValueClass(Text.class);		
	FileInputFormat.addInputPath(job1,new Path("d://data/dx/DxDataMatch"));
	
	FileOutputFormat.setOutputPath(job1,new Path("d://data/dx/DxSeven"));
	System.exit(job1.waitForCompletion(true)?0:1);
		}
}

